@model viBook.Models.Chapter
@{
    ViewBag.Title = "Edit Chapter";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section HeadContent{              
    <link href="../../Scripts/uploadify/uploadify.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/uploadify/swfobject.js" type="text/javascript"> </script>
    <script src="../../Scripts/uploadify/jquery.uploadify.v2.1.4.min.js" type="text/javascript"> </script>
}
<div class="group">
    <div class="full">
        <h1>Chapters</h1>
    </div>
</div>
@using (Html.BeginForm("Edit", "Chapters", FormMethod.Post, new { id = "EditChapterForm", @class = "gen-form" }))
{
    <div id="main">
        <ul class="tabs">
            <li class="active">@Html.ActionLink("Edit chapter", "Edit", "Chapters")</li>            
        </ul>
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Chapter</legend>
        @Html.HiddenFor(model => model.Id)
        @Html.HiddenFor(model => model.UploadedDate)
        @Html.HiddenFor(model => model.ChapterImage)
        @for (int i = 0; i < Model.Pages.Count; i++)
        { 
            @Html.HiddenFor(model => model.Pages[i].Id)
            @Html.HiddenFor(model => model.Pages[i].ChapterId)
            @Html.HiddenFor(model => model.Pages[i].ImageSource)
            @Html.HiddenFor(model => model.Pages[i].Number)
        }
        @Html.Partial("_CreateOrEdit", Model)
            <div class="form-btns">
                <input type="submit" class="form-sub" value="Save" />
                <a class="form-btn" href="@Request.UrlReferrer">Cancel</a>
            </div>
        </fieldset>
    </div>
}
